<template>
	<view class="content">
		<rich-text :nodes="detail"></rich-text>
	</view>
</template>

<script lang="ts" setup>
	//引入
	import { ref } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	import { getNoticeDetailService } from '@/api/index.js';
	
	const detail = ref('');
	
	//获取公告详情
	const getNoticeDetail = async (id) => {
		const res = await getNoticeDetailService(id);
		detail.value = res.data.content
		console.log('获取公告详情成功',JSON.parse(JSON.stringify(detail.value)))
	}
	
	onLoad((options) => {
		getNoticeDetail(options.id);
	})
</script>

<style>
.content {
  margin: 15px;
}

</style>